/**
 * 功能描述�?
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");

    //assets
    var template = require("./assets/tpl/concardbindrecord_main.tpl");
    require("./assets/css/concardbindrecord_main.css");

    //business

    //component
    var concardSubnavComp = require("./component/concardSubnavComp");
    var concardGridComp = require("./component/concardGridComp");
    var consumDetailGrid = require("./component/consumDetailGrid");

    //constant

    //handler
    var subnavEvents = require("./handler/subnavEvents");
    var gridEvents = require("./handler/gridEvents");

    //store

    var App = ELView.extend({
        attrs: {
            template: template
        },
        handler: {
        	gridHandler:gridEvents,
        	subnavHandler:subnavEvents
        },
        initComponent: function (params, widget) {
        	concardSubnavComp.initComponent(params, widget);
        	concardGridComp.initComponent(params, widget);
        	consumDetailGrid.initComponent(params, widget);
        },
        afterInitComponent: function (params, widget) {
        	widget.get("subnav").load("servicePoint",{
	          	callback: function(ret){
	          		widget.get("grid").refresh();
	          	}
	         });
        }
    });

    module.exports = App;
});
